home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gimp.idb / usr / freeware / share / gimp / scripts / textured-logo.scm.z / textured-logo.scm
Encoding:
GIMP Script-Fu Script  |  1999-07-21  |  4.5 KB  |  93 lines

  1. ;  BLENDED-DROP-SHADOW-LOGO
  2. ;  draw the specified text over a blended background using current gimp fg
  3. ;   and bg colors.  The finished blend has a drop shadow underneath that blends
  4. ;   to the specified bg-color
  5. ;  if the blend colors are specified as high intensity, the sharp option
  6. ;   should be enabled or the logo will come out blurry
  7.  
  8. (define (scale size percent) (* size percent))
  9.  
  10. (define (script-fu-textured-logo text-pattern tile-type text size font bg-color blend-fg blend-bg)
  11.   (let* ((img (car (gimp-image-new 256 256 RGB)))
  12.      (b-size (scale size 0.1))
  13.      (b-size-2 (scale size 0.05))
  14.      (f-size (scale size 0.075))
  15.      (ds-size (scale size 0.05))
  16.      (ts-size (- b-size-2 3))
  17.      (text-layer (car (gimp-text img -1 0 0 text b-size TRUE size PIXELS "*" font "*" "*" "*" "*")))
  18.      (width (car (gimp-drawable-width text-layer)))
  19.      (height (car (gimp-drawable-height text-layer)))
  20.      (blend-layer (car (gimp-layer-new img width height RGBA_IMAGE "Blend" 100 NORMAL)))
  21.      (shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Shadow" 100 NORMAL)))
  22.      (text-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Text Shadow" 100 MULTIPLY)))
  23.      (tsl-layer-mask (car (gimp-layer-create-mask text-shadow-layer BLACK-MASK)))
  24.      (drop-shadow-layer (car (gimp-layer-new img width height RGBA_IMAGE "Drop Shadow" 100 MULTIPLY)))
  25.      (dsl-layer-mask (car (gimp-layer-create-mask drop-shadow-layer BLACK-MASK)))
  26.      (old-fg (car (gimp-palette-get-foreground)))
  27.      (old-bg (car (gimp-palette-get-background))))
  28.     (gimp-image-disable-undo img)
  29.     (gimp-image-resize img width height 0 0)
  30.     (gimp-image-add-layer img shadow-layer 1)
  31.     (gimp-image-add-layer img blend-layer 1)
  32.     (gimp-image-add-layer img drop-shadow-layer 1)
  33.     (gimp-image-add-layer img text-shadow-layer 0)
  34.     (gimp-selection-all img)
  35.     (gimp-patterns-set-pattern text-pattern)
  36.     (gimp-layer-set-preserve-trans text-layer TRUE)
  37.     (gimp-bucket-fill img text-layer PATTERN-BUCKET-FILL NORMAL 100 0 FALSE 0 0)
  38.     (gimp-selection-none img)
  39.     (gimp-edit-clear img text-shadow-layer)
  40.     (gimp-edit-clear img drop-shadow-layer)
  41.     (gimp-palette-set-background bg-color)
  42.     (gimp-drawable-fill shadow-layer BG-IMAGE-FILL)
  43.     (gimp-rect-select img b-size-2 b-size-2 (- width b-size) (- height b-size) REPLACE TRUE b-size-2)
  44.     (gimp-palette-set-background '(0 0 0))
  45.     (gimp-edit-fill img shadow-layer)
  46.     (gimp-selection-layer-alpha img text-layer)
  47.     (gimp-image-add-layer-mask img text-shadow-layer tsl-layer-mask)
  48.     (gimp-palette-set-background '(255 255 255))
  49.     (gimp-edit-fill img tsl-layer-mask)
  50.     (gimp-selection-feather img f-size)
  51.     (gimp-palette-set-background '(63 63 63))
  52.     (gimp-edit-fill img drop-shadow-layer)
  53.     (gimp-palette-set-background '(0 0 0))
  54.     (gimp-edit-fill img text-shadow-layer)
  55.     (gimp-palette-set-foreground '(255 255 255))
  56.     (gimp-blend img text-shadow-layer FG-BG-RGB NORMAL SHAPEBURST-ANGULAR 100 0 REPEAT-NONE FALSE 0 0 0 0 1 1)
  57.     (gimp-selection-none img)
  58.     (gimp-palette-set-foreground blend-fg)
  59.     (gimp-palette-set-background blend-bg)
  60.     (gimp-blend img blend-layer FG-BG-RGB NORMAL LINEAR 100 0 REPEAT-NONE FALSE 0 0 0 0 width 0)
  61.     (plug-in-mosaic 1 img blend-layer 12 1 1 0.7 135 0.2 TRUE FALSE tile-type 1 0)
  62.     (gimp-layer-translate text-layer (- b-size-2) (- b-size-2))
  63.     (gimp-layer-translate blend-layer (- b-size) (- b-size))
  64.     (gimp-layer-translate text-shadow-layer (- ts-size) (- ts-size))
  65.     (gimp-layer-translate drop-shadow-layer ds-size ds-size)
  66.     (gimp-selection-layer-alpha img blend-layer)
  67.     (gimp-image-add-layer-mask img drop-shadow-layer dsl-layer-mask)
  68.     (gimp-palette-set-background '(255 255 255))
  69.     (gimp-edit-fill img dsl-layer-mask)
  70.     (gimp-image-remove-layer-mask img drop-shadow-layer APPLY)
  71.     (gimp-selection-none img)
  72.     (gimp-layer-set-name text-layer text)
  73.     (gimp-palette-set-foreground old-fg)
  74.     (gimp-palette-set-background old-bg)
  75.     (gimp-image-enable-undo img)
  76.     (gimp-display-new img)))
  77.  
  78. (script-fu-register "script-fu-textured-logo"
  79.             "<Toolbox>/Xtns/Script-Fu/Logos/Textured"
  80.             "Creates textured logos with blended backgrounds, highlights, and shadows"
  81.             "Spencer Kimball"
  82.             "Spencer Kimball"
  83.             "1996"
  84.             ""
  85.             SF-VALUE "Text Pattern" "\"Fibers\""
  86.             SF-VALUE "Mosaic Tile Type" "0"
  87.             SF-VALUE "Text String" "\"The GIMP\""
  88.             SF-VALUE "Font Size (in pixels)" "200"
  89.             SF-VALUE "Font" "\"CuneiFontLight\""
  90.             SF-COLOR "Background Color" '(255 255 255)
  91.             SF-COLOR "Starting Blend" '(32 106 0)
  92.             SF-COLOR "Ending Blend" '(0 0 106))
  93.